import React, { Component } from 'react'
import Search from './components/Search'
import List from './components/List'

export default class App extends Component {
  state = {
    list:[],
    isFirst:true,
    isLoading:false,
    err:'',
  }
  /*
  searchReData = (data)=>{
    this.setState({
      list:data
    })
    console.log('searchReData',data)
  }
  */
  updateAppState =(stateObj)=>{
    this.setState(stateObj)
  }

  render() {
    return (
      <div className="container">
        <Search updateAppState={this.updateAppState}/>
        <List {...this.state}/>
      </div>
    )
  }
}
